// 公用代码，用于处理在mini-player出现时，列表的bottom问题

import {mapGetters} from 'vuex'

export const mixinPlayList = {
  computed: {
    ...mapGetters([
      'playlist'
    ])
  },
  mounted () {
    this.handlePlayList(this.playlist)
  },
  actived () {
    this.handlePlayList(this.playlist)
  },
  watch: {
    playlist (newVal) {
      this.handlePlayList(newVal)
    }
  },
  methods: {
    handlePlayList () {
      throw new Error('you must implement handlePlayList method')
    }
  }
}
